package org.springblade.task.base.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.task.base.entity.BaseEbookOrder;
import org.springblade.task.base.mapper.BaseEbookOrderMapper;
import org.springblade.task.base.param.BaseOrderBookParam;
import org.springblade.task.base.service.IBaseEbookOrderService;
import org.springblade.task.base.vo.BaseEbookOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: TODO
 * @author syncwt
 * @date ${date} ${time}
 * @version V1.0
 */
@Service
public class BaseEbookOrderServiceImpl extends ServiceImpl<BaseEbookOrderMapper, BaseEbookOrder> implements IBaseEbookOrderService {

	@Autowired
	private BaseEbookOrderMapper baseEbookOrderMapper;

	@Override
	public List<BaseEbookOrderVO> queryEBookUserOrderCount(BaseOrderBookParam param) {
		return baseEbookOrderMapper.queryEBookUserOrderCount(param);
	}

	/**
	 * 查询首次下单用户
	 * @return
	 */
	@Override
	public List<BaseEbookOrderVO> queryFirstOrderUserList(List<String> pinList) {
		return baseEbookOrderMapper.queryFirstOrderUserList(pinList);
	}

	/**
	 * 查询订单金额分布区间数
	 * @param param
	 * @return
	 */
	public Map<String, BigDecimal> queryOrderAmountRange(BaseOrderBookParam param) {

		return baseEbookOrderMapper.queryOrderAmountRange(param);
	}

	/**
	 * 查询今日订单金额
	 * @param param
	 * @return
	 */
	public BaseEbookOrderVO queryTodayOrderAmount(BaseOrderBookParam param) {
		return baseEbookOrderMapper.queryTodayOrderAmount(param);
	}

	/**
	 * 查询付费用户列表
	 * @param param
	 * @return
	 */
	public List<BaseEbookOrderVO> queryPayUserList(BaseOrderBookParam param) {
		return baseEbookOrderMapper.queryPayUserList(param);
	}

	/**
	 * 查询日期区间付费用户列表
	 * @param param
	 * @return
	 */
	public List<String> queryDateRangePayUserList(BaseOrderBookParam param) {
		return baseEbookOrderMapper.queryDateRangePayUserList(param);
	}

	/**
	 * 查询付费订单数
	 * @param param
	 * @return
	 */
	public Integer queryPayOrderCount(BaseOrderBookParam param) {
		return baseEbookOrderMapper.queryPayOrderCount(param);
	}

	/**
	 * 查询每日订单数据
	 * @param param
	 * @return
	 */
	public List<BaseEbookOrderVO> queryDailyOrderList(BaseOrderBookParam param) {
		return baseEbookOrderMapper.queryDailyOrderList(param);
	}
}
